<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>系统设置</title>
<!-- css 样式引入 -->
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap-table.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="../../css/index.css">
<!-- js引入 -->
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap-table.js"></script>
<script type="text/javascript" src="../../js/bootstrap-table-zh-CN.js"></script>
<script src="../../laydate/laydate.js"></script>
<script type="text/javascript"
	src="../../js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript"
	src="../../js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="js/setSystem.js"></script>
</head>
<body>
	<!-- 标题 -->
	<table class="btbHead">
		<tr>
			<td style="width: 25%;"><i class="fa fa-align-justify"></i>&nbsp;系统设置</td>
			<td style="text-align: right;"><a href="#" id="addBtn"
				class="btn btn-info" data-toggle="modal" data-target="#addModal"><i class="fa fa-plus"></i>&nbsp;添加</a></td>
		</tr>
	</table>

	<!-- 模糊查询条件 -->
	<form role="form" class="form-inline searchForm">
		<div class="form-group">
			<label for="name">查询条件</label> <input type="text"
				class="form-control" id="keyWord" placeholder="请输入配置名称"
				style="width: 250px;"> <a href="javascript:doQuery()"
				class="btn btn-default"><i class="fa fa-search"></i></a>
		</div>
	</form>

	<div class="slideLine" style="margin-top: 10px; margin-bottom: 10px;"></div>

	<!-- 数据表格 -->
	<table data-toggle="table" id="dataTable" data-pagination="true">
		<thead>
			<tr>
				<th data-field="id" data-align="center">编号</th>
				<th data-field="configName">配置名称</th>
				<th data-field="configValue">配置值</th>
				<th data-field="defaultValue">默认的配置值</th>
				<th data-field="createTime" data-formatter="dateFormatter">创建时间</th>
				<th data-field="opraite" data-formatter="operateFormatter">操作</th>
			</tr>
		</thead>
	</table>
	<!--增加模态框-->
	<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
		aria-labelledby="addModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">新增系统设置</h4>
				</div>
				<div class="modal-body" id="iptBox">
					<form class="form-horizontal form-inline commitForm" id="addForm"
						role="form">
						<table width="100%">
							<tr>
								<td style="text-align: right; width: 16%;">配置名称</td>
								<td><input id="" class="form-control" name="configName"
									type="text" value="" style="width: 100%"></td>
								<td style="text-align: right; width:;"><span>配置值</span></td>
								<td><input id="" class="form-control" name="configValue"
									type="text" value="" style="width: 100%"></td>
							</tr>
							<tr>
								<td style="text-align: right; width:;">默认配置值</td>
								<td><input id="" class="form-control" name="defaultValue"
									type="text" value="" style="width: 100%"></td>
								<td style="text-align: right;"><span>生效时间</span></td>
								<td width=""><input type="text" class="demo-input"
									name="workTime" placeholder="请选择日期" id="test2"></td>
							</tr>
						</table>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" onclick="add()" class="btn btn-primary"
						id="btnSave">确定</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 信息删除确认 -->
	<div class="modal fade" id="delModal">
		<div class="modal-dialog">
			<div class="modal-content message_align">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title">提示信息</h4>
				</div>
				<div class="modal-body">
					<p>您确认要删除吗？</p>
				</div>
				<div class="modal-footer">
					<input type="hidden" id="lid" />
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<a onclick="remove()" class="btn btn-success" data-dismiss="modal">确定</a>
				</div>
			</div>
		</div>
	</div>
	<!-- 修改确认 -->
	<div class="modal fade" id="modifyModal" tabindex="-1" role="dialog"
		aria-labelledby="modifyModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width: 900px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">修改商品信息</h4>
				</div>
				<div class="modal-body" id="iptBox">
					<form class="form-horizontal form-inline commitForm"
						id="modifyForm" role="form">
						<table width="100%">
							<tr>
							<td style="text-align: right; width: 16%;">配置编号</td>
								<td><input id="m_id" class="form-control" name="id"
									type="text" value="" style="width: 100%" readonly="true"></td>
								<td style="text-align: right; width: 16%;">配置名称</td>
								<td><input id="m_configName" class="form-control" name="configName"
									type="text" value="" style="width: 100%"></td>
							</tr>
							<tr>
								<td style="text-align: right; width:;"><span>配置值</span></td>
								<td><input id="m_configValue" class="form-control" name="configValue"
									type="text" value="" style="width: 100%"></td>
								<td style="text-align: right; width:;">默认配置值</td>
								<td><input id="m_defaultValue" class="form-control" name="defaultValue"
									type="text" value="" style="width: 100%"></td>
							</tr>
							<tr>
							<td style="text-align: right;"><span>生效时间</span></td>
							<td width=""><input type="text" class="demo-input"
									name="workTime"  id="m_workTime"></td>
							</tr>	 
						</table>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消
					</button>
					<button type="button" class="btn btn-primary" id="btnSave"
						onclick="modify()">确定</button>
				</div>
			</div>
		</div>
	</div>

</body>
<script type="text/javascript">
	//删除模态框事件监听
	$('#delModal').on('show.bs.modal', function(event) {
		var button = $(event.relatedTarget)
		var lid = button.data('lid')
		var modal = $(this)
		$("#lid").val(lid);
	})

	// 修改模态框监听
	$('#modifyModal').on('show.bs.modal', function(event) {
		var button = $(event.relatedTarget)
		var id = button.data('id')
		var configname = button.data('configname')
		var configvalue = button.data('configvalue')
		var defaultvalue = button.data('defaultvalue')
		var worktime = button.data('worktime')
		var modal = $(this)
		modal.find('#m_id').val(id);
		modal.find('#m_configName').val(configname);
		modal.find('#m_configValue').val(configvalue);
		modal.find('#m_defaultValue').val(defaultvalue);
		modal.find('#m_workTime').val(new Date(worktime).Format("yyyy-MM-dd"));
	});
</script>
</html>